package com.cjjd.c.feature.home;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

import com.cjjd.c.R;
import com.fe.library.adapter.BaseAdapter;
import com.fe.library.widget.AbsTab;
import com.fe.library.widget.DefaultTab;

/**
 * Created by dadagm on 17/9/8.
 */

public class MTabAdaptet extends BaseAdapter {
    private String[] mTextArray;
    private int mTextColor = -16777216;
    private int[] mIconImageArray;
    private int[] mSelectedIconImageArray;

    public MTabAdaptet(Context context, Fragment[] fragmentArray, FragmentManager fragmentManager, String[] textArray, int[] iconImageArray, int[] selectedIconImageArray) {
        super(context, fragmentArray, fragmentManager);
        this.mTextArray = textArray;
        this.mIconImageArray = iconImageArray;
        this.mSelectedIconImageArray = selectedIconImageArray;
    }

    public AbsTab getTab(int index) {
        DefaultTab defaultTab = new DefaultTab(this.mContext, index);
        defaultTab.setText(this.mTextArray[index]);
        defaultTab.setTextColor(R.color.colorPrimary,R.color.textColorMiddle);
//        defaultTab.setTextColor(R.color.red, this.mSelectedTextColor);
        defaultTab.setIconImage(this.mIconImageArray[index], this.mSelectedIconImageArray[index]);
        return defaultTab;
    }
}
